export default {};
// 接口类型
/**
 * 登录
 * @param {String} phone
 * @param {String} password
 * @returns
 */
/* interface login {
  phone: string,
  password: string,
}

export const loginApi = (params: login) => {
  // axios
  console.log(params);

}


loginApi({ password: "1", "phone": "1234234" }) */

interface customer {
  pageNum: number,
  pageSize: number,
  phone?: string,  // ?,表示是可选成员
  state?: string,
  name?: string,
  creatTime?: string,
  address?: string,
}

interface ajaxParams {
  url: string,
  type?: string,
  data?: object,
  async?: boolean,
  readonly success: Function, // readonly, 表示这个属性，只读
}

const myAjax = (obj: ajaxParams) => {

}

myAjax({
  url: "/login", type: 'get', data: {}, success: () => {

  }
})

// 动态添加属性
interface MyUser {
  uname: string,
  password: string,
  sex: string,
  [prop: string]: string | number;// 允许你动态 的扩展对象的属性； "|" 表示或者 ,
}

let a: MyUser = { sex: '男', uname: "12", password: "12312" }
a.money = 10000;
// a.isGirl = false; // 不能将类型“boolean”分配给类型“string | number”。

a.sid = "1231231231231231";
// a.1 = 123; // 意外的关键字或标识符。

